package cn.itsource.mapper;

import cn.itsource.domain.Goods;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

public interface GoodsMapper {

     @Update("update t_goods set count=count-#{num} where id = #{id}")
     void updateNum(Map<String,Object> params);

     @Select("select * from t_goods where id = #{id}")
     Goods laodById(Long id);

     @Select("select * from t_goods where id = #{id} for update")
     Goods laodByIdForUpdate(Long id);
}
